﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class admin_Control_uclCheckRefreshed : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    public bool isRefreshed
    {
        get
        {
            if (_flag.HasValue)
                return _flag.Value;
            else
            {
                _flag = this.Cache[Num] != null;
                return _flag.Value;
            };
        }
    }

    private bool? _flag;

    private string Num
    {
        get
        {
            if (ViewState["num"] == null)
                return Guid.NewGuid().ToString();
            else
                return (string)ViewState["num"];
        }
        set
        {
            ViewState["num"] = value;
        }
    }

    protected void Page_PreRender(object sender, EventArgs e)
    {
        this.Page.Unload += new EventHandler(Page_Unload);
        _num = Num;
        Num = Guid.NewGuid().ToString();
    }

    private string _num;

    void Page_Unload(object sender, EventArgs e)
    {
        this.Cache[_num] = 1;
    }
}
